from _mainlib.include import *



class daemon(object):
    def __init__(self, func: function):
        self.func = func
        self.close_events = []

    def Add_Close_Event(self, func:str):
        self.close_events.append(func)

    def start(self):
        self.func()

        for event in self.close_events:
            eval(event)